﻿#include "igbtprotocol.h"

QString IGBTProtocol::cmdTypeCaption(IGBTProtocol::CmdType cmdType)
{
    if(cmdType == IGBTProtocol::Cmd_SingleOpenCap)
        return QStringLiteral("单次开通采集");
    else if(cmdType == IGBTProtocol::Cmd_SingleCloseCap)
        return QStringLiteral("单次关断采集");
    else if(cmdType == IGBTProtocol::Cmd_TimerCap)
        return QStringLiteral("定时采集");
    else if(cmdType == IGBTProtocol::Cmd_FaultCap)
        return QStringLiteral("故障触发采集");
    else if(cmdType == IGBTProtocol::Cmd_StopCap)
        return QStringLiteral("停止采集");
    else if(cmdType == IGBTProtocol::Cmd_ExecRes)
        return QStringLiteral("命令回码");
    else return QStringLiteral("未定义");
}

QString IGBTProtocol::cmdExecResCaption(IGBTProtocol::CmdExecResType cmdExecRes)
{
    if(cmdExecRes == IGBTProtocol::CmdExecRes_Cplt)
        return QStringLiteral("成功");
    else if(cmdExecRes == IGBTProtocol::CmdExecRes_Failed)
        return QStringLiteral("失败");
    else if(cmdExecRes == IGBTProtocol::CmdExecRes_Running)
        return QStringLiteral("执行中");
    else return QStringLiteral("未定义");
}
